//
//  ViewController.swift
//  Calculator
//
//  Created by zack on 2017/4/22.
//  Copyright © 2017年 workorz. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    @IBOutlet weak var display: UILabel!
    
    var isInputNumberInMiddle: Bool = false
    
    @IBAction func appendDigit(_ sender: UIButton) {
        
        let digit = sender.currentTitle!
        
        print("digit = \(digit)")
        
        if isInputNumberInMiddle {
            display.text = display.text! + digit;
        }
        else {
            display.text = digit
            isInputNumberInMiddle = true
        }
        
    }

}

